using System;
using System.Collections.Generic;
using System.Text;
using SP.Parameter;

namespace SP.HwLowProfileRS
{
    /// <summary>
    /// A fusion which flips the vertex-tangent according to the vertex color
    /// </summary>
    public class UVScrollingFusion : AbstractFusion
    {
        public UVScrollingFusion()
        {
            AddParameter(new Vec2Parameter("uv1ScrollSpeed").SetDesc("Scroll Speed (U & V) of UV channel 1.\nValue [0.0-1.0]."));
        }

        public override string Name
        {
            get { return "UVScrolling"; }
        }

        public override string Desc
        {
            get { return "UV scrolling effect of UV channel 1.\nDo NOT use this with SpriteMap or BillboardScaling!"; }
        }

        public override Stage Stage
        {
            get { return Stage.Vertex0; }
        }

        public override int UVChannelCount
        {
            get { return 1; }
        }

        public override void Code(StringBuilder b, string platform)
        {
            AddLine(b, "input.UVDiffuse += cTime * uv1ScrollSpeed + cCustom1.xy;");
        }
    }
}
